using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LevelSavePoint : MonoBehaviour
{
    bool isTrigger = false;
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if(!isTrigger && LayerMask.LayerToName(collision.gameObject.layer).Equals("Player"))
        {
            isTrigger = true;
            PlayerData data = SaveManager.Instance.LoadPlayerData();
            data.Position = transform.position;
            SaveManager.Instance.SavePlayerData();
        }
    }
}
